cmake_minimum_required(VERSION 3.0.2)
project(cg_remote_control)

add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
  cg_interfaces
  roscpp
  std_msgs
)

catkin_package()

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

add_executable(virtual_bridge 
  src/virtual_bridge.cpp 
  src/udp_backend.cpp
  src/net_endpoint.cpp)
target_link_libraries(virtual_bridge ${catkin_LIBRARIES})

add_executable(virtual_bridge_fixed 
  src/virtual_bridge_fixed.cpp 
  src/udp_backend.cpp
  src/net_endpoint.cpp)
target_link_libraries(virtual_bridge_fixed ${catkin_LIBRARIES})

add_executable(chassis_struct_manager 
  src/chassis_struct_manager.cpp
  src/udp_backend.cpp
  src/net_endpoint.cpp)
target_link_libraries(chassis_struct_manager ${catkin_LIBRARIES})

add_executable(udp_test
  test/udp_test.cpp
  src/udp_backend.cpp
  src/net_endpoint.cpp)
target_link_libraries(udp_test ${catkin_LIBRARIES})

add_executable(udp_receiver
  test/udp_receiver.cpp
  src/udp_backend.cpp
  src/net_endpoint.cpp)
target_link_libraries(udp_receiver ${catkin_LIBRARIES})

add_executable(local_loopback_test
  test/local_loopback_test.cpp)
target_link_libraries(local_loopback_test ${catkin_LIBRARIES})